/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package server;

/**
 *
 * @author Anastasia
 */
import java.net.*;
import java.io.*;
import java.util.Set;

import java.util.HashMap;
import  java.util.Map;

public class Server {


    public static final int PORT = 8080;

    public static void main(String[] args) throws IOException {



        ServerSocket s = new ServerSocket(PORT);
        System.out.println("Started command: " + s);


            Socket socket = s.accept();

                System.out.println("Connection accepted: " + socket);





        BufferedInputStream bis = new BufferedInputStream(socket.getInputStream());
        ObjectInputStream ois = new ObjectInputStream(bis);
        try{

            Exchanger changer = (Exchanger) ois.readObject();
            System.out.println(changer.getCommand());
        }catch(Exception e){}

        bis.close();
        ois.close();
        socket.close();
        s.close();

    }
